package com.jyw.system.domain.dto;

import com.jyw.common.constant.Constants;
import com.jyw.system.domain.SysTeam;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;

/**
 * @author 沈峻
 * @ClassName TeamAddDto
 * @Description TODO
 * @Date 2023/8/8 9:43
 **/
@ApiModel("小组新增请求实体")
@Data
public class TeamAddDto {

    @ApiModelProperty("小组名称")
    @NotEmpty(message = "小组名称不能为空")
    private String teamName;

    @ApiModelProperty("小组事务")
    private String teamBusiness;

    @ApiModelProperty("所属科室")
    private Long deptId;

    @ApiModelProperty("排序号")
    private Long sort;

    public SysTeam buildSysTeam() {
        SysTeam team = new SysTeam();
        team.setTeamName(getTeamName());
        team.setTeamBusiness(getTeamBusiness());
        team.setDeptId(getDeptId());
        team.setDelFlag(Constants.DEL_FLAG_EFFECTIVE);
        team.setIsEnable(Constants.BOOL_TRUE);
        return team;
    }
}
